home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / prn_form.cpp < prev    next >
C/C++ Source or Header  |  1994-10-10  |  3KB  |  73 lines

  1. #include <stdlib.h>
  2. #include "prn_form.h"
  3.  
  4.     char* printMenuList[] = { " Epson 9", " Epson 24", "Laser ", "" };
  5.     char* densityMenuList[] = { " Double", " Quadruple",
  6.                                 " LJ 100 ", " LJ 150", "" };
  7.     char* paperMenuList[] = { " Yes", " No", "" };
  8.  
  9.     char* hotPrintList = "GCK";
  10.     char* hotDensityList = "LX";
  11.     char* hotPaperList = "LY";
  12.  
  13.     int s = pScreenSet->g_driver == VGA ? 0 : 1;
  14.     rect r_print = rect(31, 5, 47, 13);
  15.     rect r_density = rect(48, 5, 72, 13 + s);
  16.     rect r_paper = rect(31, 14, 44, 18);
  17.  
  18.  
  19. void Form::Form() : Bl(rect(30, 3, 73, 24), "",
  20.                     " button Print - Yes, ESC - No ", 6,
  21.             FIXED, SHOW_BORDER, SHOW_BORDER, 47, 16, 16)
  22.     {
  23.     printer_type = new
  24.         TextMenu(r_print, "", " Printer ", hotPrintList, 1, 1,
  25.                printMenuList, rect(0, 24, 79, 25), 0, NULL, NULL,
  26.                FIXED, 3, STANDART_BORDER, STANDART_BORDER, 16, 16);
  27.  
  28.     density = new TextMenu(r_density, "", " Density ", hotDensityList,
  29.         1, 1, densityMenuList, rect(0, 24, 79, 25), 0, NULL, NULL,
  30.                FIXED, 3, STANDART_BORDER, STANDART_BORDER, 16, 16);
  31.     paper = new TextMenu(r_paper, "", "Sensor", hotPaperList, 1, 1,
  32.         paperMenuList, rect(0, 24, 79, 25), 0, NULL, NULL,
  33.                FIXED, 3, STANDART_BORDER, STANDART_BORDER, 16, 16);
  34.     pass = new CaptureEditLine(loc(45, 15), 3, " Pass. ", C_RIGHT);
  35.     lt = new CaptureEditLine(loc(59, 15), 4, " Left.", C_RIGHT);
  36.     mx = new CaptureEditLine(loc(45, 16), 3, " Mult X", C_RIGHT);
  37.     my = new CaptureEditLine(loc(59, 16), 3, " Mult Y", C_RIGHT);
  38.     dx = new CaptureEditLine(loc(45, 17), 3, " Div X ", C_RIGHT);
  39.     dy = new CaptureEditLine(loc(59, 17), 3, " Div Y ", C_RIGHT);
  40.     copies = new CaptureEditLine(loc(45, 18), 3, " Copy ", C_RIGHT);
  41.     pass->put_string("1");
  42.     lt->put_string("0"); mx->put_string("1"); my->put_string("1");
  43.     dx->put_string("1"); dy->put_string("1");
  44.     copies->put_string("1");
  45.     go = new Button(rect(46, 21, 58, 22),
  46.               "P R I N T", BUTTON_BORDER, 16);
  47.  
  48.     go->set_ret(RET_OK | RET_MOUSE | RET_CANCEL);
  49.     insert(paper, 1); insert(lt, 1); insert(copies, 1); insert(dy, 1);
  50.     insert(dx, 1); insert(my, 1); insert(mx, 1); insert(pass, 1);
  51.     insert(density, 1); insert(printer_type, 1);
  52.     insert(go, 1);
  53.     assign(printer_type, cancel_element, AC_CANCEL);
  54.     printer_type->set_ret(RET_CANCEL);
  55.     }
  56. /////////////////////////
  57. void Form::exe(int act)
  58.     {
  59.     Bl::exe(act);
  60.     p_t = printer_type->get_choice();
  61.     d = density->get_choice();
  62.     pap = paper->get_choice();
  63.     l = atoi(lt->get_string());
  64.     pas = atoi(pass->get_string());
  65.     m_x = atoi(mx->get_string());
  66.     m_y = atoi(my->get_string());
  67.     d_x = atoi(dx->get_string());
  68.     d_y = atoi(dy->get_string());
  69.     cop = atoi(copies->get_string());
  70.     global_num = 1;
  71.     mouseHideCursor();
  72.     }
  73.